home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
stopframe.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-06-06
|
3KB
|
79 lines
/* StopFrame.rexx Grabs frames on cue from GPI trigger for stop-action animation */
/* By Arnie Cachelin © 1992 NewTek Inc. */
/*
This program will grab and save frames on cue from the GPI trigger.
If you enter a number to grab, it will save that many then exit.
Otherwise, 3 frames will be saved, then the prog. will exit. Since
the Toaster is waiting for GPI input most of the time, it will not
respond to anything else, which you may find annoying. You can easily
give your Toaster GPI pulses by attaching a spare mouse or joystick to
the second mouse port then clicking the button. You can also find long
joystick extender cables at places like Radio Shack.
To grab frames for a claymation of stop-motion style animation, setup your
camera and 'actors', hook up a GPI trigger, and start this script with
appropriate arguments. When your first frame is ready, hit the trigger
to grab and save it. The toaster will then go into an 'onionskin' mode
where the camera is half dissolved over the last frame for ease of
positioning the actors. When you hit the GPI again, the Toaster will leave
onionskin mode and grab the next frame, then return to onionskin mode.
For best results, watch out for stray shadows, or shadows from the sun which
will change over the course of your shoot.
*/
OPTIONS RESULTS
parse arg count name startframe
if count="" then count=3
if startframe="" then startframe=0
TOASTERLIB="ToasterARexx.port"
IF ~SHOW('Libraries',TOASTERLIB) THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN say "Please start your Toaster"
say "Saving "count" frames as "name
Switcher(TOSW) /* Go to Switcher screen */
if ~Switcher(CKGD,A48) then Switcher(GRID,A11) /* Select Fade in getsmall */
else Switcher(GRID,A48)
Switcher(P001)
Switcher(LVID)
Switcher(PDV1)
Switcher(P001)
Switcher(SGPI,POS) /* Set GPI trigger to positive (leading edge of pulse) */
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in for first frame */
Do i=startframe to startframe+count-1
Switcher(FVID) /* Freeze frame */
Frame=right(trim(i),3,"0")
if name="" then c=SaveNextFrame("grab") /* Save into Framestore if no name */
else do /* Or Save RGBs into path/name specified */
fname =strip(name)||right(i,3,'0')
say fname
call Switcher(SRGB,fname,0,5)
end
Switcher(P001)
Switcher(MDV1)
Switcher(TBAR,255)
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in */
Switcher(AUTO)
Switcher(LVID) /* Set to live digital video */
Switcher(PDV1)
Switcher(P001)
Switcher(FRES)
Switcher(WAIT,60)
end
Switcher(TOWB) /* Go to Workbench screen */
exit
SaveNextFrame: Procedure
arg name
N=Switcher(STAT,KNUM) /* Get the current keypad number */
fs=N+1
do while Switcher(FMXI,fs) & fs~=N /* Is the frame already there? */
if fs=999 then fs=0 /* wrap around at last frame */
else fs=fs+1
end
if fs=N then t=10 /* got to starting frame without finding open fs */
else t=Switcher(FMSV,fs,name) /* Save frame */
return t